<?php

namespace App\Models\Applet\User;

class UserSlaughterAddressModel extends BaseUserModel
{
    protected $table = 'user_slaughter_address';

    /**
     * 根据用户宰杀申请id查询数据
     * @param int $userSlaughterId
     * @param array $fields
     * @return array
     */
    public function getItemByUserSlaughterId(int $userSlaughterId, array $fields): array
    {
        $result = $this->select($fields)
                       ->where('user_slaughter_id', $userSlaughterId)
                       ->where('deleted', self::DELETED_NO)
                       ->first();
        return $result ? $result->toArray() : [];
    }
}
